package com.example.studyplanning.mapper;

import com.example.studyplanning.entity.Log;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface LogMapper {
    //（后台）5.2选择查询日志信息
    @Select("SELECT logID,logContent,DATE_FORMAT(logDate,'%Y-%m-%d') as date_time from log where adminID = #{adminID}")
    List<Log>  findAllLog(Integer adminID);

    //(后台）5.2 插入日志信息
    @Insert("insert into log(logContent,adminID) values (#{logContent},#{adminID})")
    Integer insertLog(@Param("logContent")String logContent, @Param("adminID")Integer adminID);

    //（后台）5.3 删除日志信息
    @Delete("delete from log where logID=#{logID}")
    Integer DelLog(Integer logID);
}
